package com.spark;

import com.spark.exception.enums.ResponseEnum;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
@SpringBootApplication
public class ExceptionDemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(ExceptionDemoApplication.class, args);
    }

    @RequestMapping
    public String test(@RequestParam("name") String name){//
        //校验name存在
        ResponseEnum.LICENCE_NOT_FOUND.assertNotNull(null);
        return "test";
    }

    @RequestMapping("/success")
    public String success(){
        return "成功啦";
    }
}
